<div id="history">

<script type="text/javascript" src="{{ asset('bundles/rtscraftmain/js/ajax.js') }}"></script>

{% for result in results %}
  <div class="main_bloc">
    <div class="article_title_bloc">
      <span class="article_title_left">
	{% if result.articleId.element.category.name is defined %}
	  {{result.articleId.element.category.name}}
        {% else %}
          N/A
        {% endif %}
      </span>
      <div class="article_title_right">
	{% if result.articleId.element.name is defined %}
	  <a href="#" onclick="submitForm('article/{{result.articleId.element.name}}')">{{result.articleId.element.name}}</a>
        {% else %}
          {{result.articleId.title}}
	{% endif %}
      </div>
    </div>
    <div class="article_desc_bloc">
      {% if result.articleId.element.imgURL is defined %}
        <img class="article_img" src="{{result.articleId.element.imgURL}}" />
      {% else %}
	<img class="article_img" src="#" /> <!-- no image -->
      {% endif %}

	{% if result.text is defined %}
        <div class="article_text">{{result.text | raw}}</div>
      {% else %}
        error fetching text for this article
      {% endif %}
    </div>
 </div>
    {% endfor %}
</div>
